extends Node2D

@export var res: ResDemo = null

func _init() -> void:
	if "res" in self:
		set("res", null)
		get("res")
		print("存在 res 变量")
	if self.has_method("test_func"):
		pass
	print("main init")

func _enter_tree() -> void:
	var node_demo: NodeDemo = NodeDemo.new("老李")
	self.add_child(node_demo)
	var node_demo1: NodeDemo = NodeDemo.new("老李")
	self.add_child(node_demo1)
	node_demo.queue_free()
	node_demo.free()
	print("main _enter_tree")
	set_meta("name", "老李游戏学院")

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	get_tree().get_nodes_in_group("Node")
	var scene_tree :SceneTree = get_tree()
#	scene_tree.change_scene_to_file()
#	scene_tree.get_first_node_in_group()
	await scene_tree.create_timer(1).timeout
#	scene_tree.quit()
	print("main _ready")
	print(res.health)
	var obj = ObjectDemo.new()
	print(get_meta("name"))
